home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Blitz2 / BlitzFaq / FaqLists / ReceiveArexxMex.txt < prev    next >
Encoding:
Text File  |  1996-09-05  |  1.1 KB  |  42 lines

  1. XINCLUDE rexxstorage.bb2 ; from rexx/storage.h
  2.  
  3. DefType.MsgPort *rexxport
  4. DefType.l
  5.  
  6. rexxname$="BLITZBLANK"
  7. *rexxport=CreateMsgPort_()
  8. If *rexxport
  9.   *rexxport\mp_Node\ln_Name=&rexxname$
  10.   AddPort_ *rexxport
  11.   rxsigflag=1LSL*rexxport\mp_SigBit
  12.   running=True
  13.   ;main loop
  14.   Repeat
  15.     sig=Wait_(rxsigflag|#SIGBREAKF_CTRL_C)
  16.     If sig & rxsigflag
  17.       Repeat
  18.         *rexxmsg=GetMsg_(*rexxport)
  19.         If *rexxmsg
  20.           rexxresultcode=0  
  21.           rexxresult$="OK"
  22.           comm$=UCase$(Peek$(*rexxmsg\rm_Args))
  23.  
  24.           ;do something with comm$
  25.           ;decide if everything is allright or not -> rexxresultcode<>0
  26.           ;if everything is allright, you can give back rexxresult$
  27.  
  28.           If (*rexxmsg\rm_Action & #RXFF_RESULT)<>0 AND rexxresultcode=0
  29.             *rexxmsg\rm_Result2=CreateArgString_(&rexxresult$,Len(rexxresult$))
  30.           EndIf
  31.           ReplyMsg_ *rexxmsg
  32.         EndIf 
  33.       Until *rexxmsg=0 
  34.     EndIf
  35.     If sig & #SIGBREAKF_CTRL_C
  36.       running=False
  37.     EndIf
  38.   Until running=False
  39.   RemPort *rexxport
  40.   DeleteMsgPort_ *rexxport
  41. EndIf
  42.